<script type="text/javascript">
  function displayRow(){
    var row = document.getElementById("captionRow");
    if (row.style.display == '') row.style.display = 'none';
    else row.style.display = '';
  }
</script>
<h4><%= t('available_suppliers') %></h4>
<table class="index">
	<thead>
		<tr>
			<th><%= t("name") %></th>
			<th><%= t("action") %></th>
		</tr>
	</thead>
	<tbody>
    <% @available_suppliers.each do |supplier| %>
      <tr id="<%= dom_id(supplier) %>">
        <td><%= supplier.name %></td>
		    <td class="actions">
          <%= image_tag "spinner.gif", :style => "display:none", :id => "#{dom_id(supplier, :spinner)}" %>		    
		      <%= link_to_remote icon('add') + ' ' + t('select'), 
		                         {:url => select_admin_product_supplier_path(@product, supplier),
		                         :loading => "jQuery('##{dom_id(supplier, :spinner)}').show()",
		                         :update => 'selected-supplier',
		                         :complete => "jQuery('##{dom_id(supplier)}').remove(); jQuery('##{dom_id(supplier, :spinner)}').hide();"}, :class => 'iconlink' %>
		    </td>        
      </tr>
    <% end %>
    <% if @available_suppliers.empty? %>
     <tr><td colspan="3"><%= t('no_match_found') %>.</td></tr>
    <% end %>
  </tbody>
</table>
